<?php
	include 'ZionHeader.inc';
?>

<html>
<body>
<h1>Deleted User!</h1>

<?php
$userID = $_POST['ID'];

$name = $_SESSION['UName']; // retrieve user ID
$AccountType = $_SESSION['AType'];

include 'DatabaseConnect.inc';

	$query = "DELETE FROM Comment WHERE userID = '$userID'";
	mysql_query($query); 

	$query = "DELETE FROM Bookmark WHERE User_LoginID = '$userID'";
	mysql_query($query); 
	
	$query = "DELETE FROM imageTable WHERE user = '$userID'";
	mysql_query($query); 

	$query = "DELETE FROM Notification WHERE RegUserID = '$userID'";
	mysql_query($query);
	
	$query = "DELETE FROM Announcement WHERE userID = '$userID'";
	mysql_query($query);

	//Deleting from three sub groups of user
	$query = "DELETE FROM Admin WHERE LoginID = '$userID'";
	mysql_query($query);
	
	$query = "DELETE FROM RegisteredUser WHERE LoginID = '$userID'";
	mysql_query($query);
	
	$query = "DELETE FROM Dealer WHERE LoginID = '$userID'";
	mysql_query($query);
		
	//Deleting from actual user table	
	$query = "DELETE FROM User WHERE LoginID = '$userID'";
	mysql_query($query);

mysql_close();

?>

<h1>User has been deleted!</h1>
<br />
<br />
<a href="announcement.php">Return To Index</a>


</body>
</html>
